//
//  KCUserSingle.m
//  Jade
//
//  Created by king on 16/8/16.
//  Copyright © 2016年 KC. All rights reserved.
//

#import "KCUserSingle.h"

@implementation KCUserSingle

+ (instancetype)shareInstance{
    
    static dispatch_once_t onceToken;
    static KCUserSingle *userSingle = nil;
    dispatch_once(&onceToken, ^{
        userSingle = [[self alloc]init];
    });
    return userSingle;

}

- (void)setAvatar:(NSString *)avatar {
    _avatar = avatar;
    [DEFAULTS setObject:[NSString stringWithFormat:@"%@%@",HOST_IMAGE_URL,_avatar] forKey:kUserInfo_avatar];
}
- (void)setNickname:(NSString *)nickname{
    _nickname = nickname;
    [DEFAULTS setObject:_nickname forKey:kUserInfo_uname];
}
- (void)setId:(NSString *)id{
    _id = id;
    [DEFAULTS setObject:_id forKey:kUserInfo_uid];
}
- (void)setToken:(NSString *)token{
    _token = token;
    [DEFAULTS setObject:_token forKey:kUserInfo_token];
}
- (void)setRating:(NSString *)rating {
    _rating = rating;
    [DEFAULTS setObject:_rating forKey:kUserInfo_rating];
}
- (void)setGender:(NSString *)gender {
    _gender = gender;
    [DEFAULTS setObject:_gender forKey:kUserInfo_gender];
}
- (void)setLocation:(NSString *)location {
    _location = location;
    [DEFAULTS setObject:_location forKey:kUserInfo_location];
}

@end
